package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.SysSecuritySetting;
import com.ruoyi.system.mapper.SysSecuritySettingsMapper;
import com.ruoyi.system.service.ISysSecuritySettingsService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 用户 业务层处理
 *
 * @author ruoyi
 */
@Service
public class SysSecuritySettingsServiceImpl implements ISysSecuritySettingsService {
    private static final Logger log = LoggerFactory.getLogger(SysSecuritySettingsServiceImpl.class);
    @Autowired
    private SysSecuritySettingsMapper sysSecuritySettingsMapper;

    /**
     * 通过ID查询安全配置信息
     *
     * @return 安全配置信息
     */
    @Override
    public SysSecuritySetting selectSecuritySettingByOne(Long userId) {
        return sysSecuritySettingsMapper.getInfo(userId);
    }

    @Override
    public List<SysSecuritySetting> getAll() {
        return sysSecuritySettingsMapper.getAll();
    }

    /**
     * 新增安全配置信息
     *
     * @param sysSecuritySetting 安全设置信息
     * @return
     */
    @Override
    public Integer insertSecuritySetting(SysSecuritySetting sysSecuritySetting) {
        // 插入数据行数
        return sysSecuritySettingsMapper.insertSecuritySetting(sysSecuritySetting);
    }

    @Override
    public Integer updateById(SysSecuritySetting sysSecuritySetting) {
        return sysSecuritySettingsMapper.updateById(sysSecuritySetting);
    }
}
